<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!--{include file='comm/header.tpl'}-->
    <title>维权投诉列表</title>
    <!--{include file='comm/comm_cal.tpl'}-->
</head>
<body>

<div class="container">

    <div class="comm_content">

            <div class="search-box">
                <div style="position:relative">
                    <form class="form-inline" id="search_form" onsubmit="return false;">
                        <table>
                            <tbody>
                            <tr>
                                <td>

                                    <span>订单编号：<input type="text" class="form-control w150" name="bill_code"></span>
                                    <span>会员名：<input type="text" class="form-control w150" name="custID"></span>

                                    <span>
                                        投诉状态：<select class="form-control" id="complain_status" name="complain_status">
                                            <option value="">请选择</option>
                                            <option value="1">未处理</option>
                                            <option value="2">正在处理</option>
                                            <option value="3">已解决</option>
                                        </select>
                                    </span>

                                    <span>
                                        创建日期：
                                        <input class="form-control w100" id="startDate" name="startDate" value="" readonly="readonly" type="text" />
                                        ～
                                        <input class="form-control w100" id="endDate" name="endDate" value="" readonly="readonly" type="text" />
                                        <button type="button" class="btn btn-default btn-sm" onclick="bill.timeClear1();">清 空</button>
                                    </span>
                                    <span>
                                        投诉处理日期：
                                        <input class="form-control w100" id="auditStartDate" name="auditStartDate" value="" readonly="readonly" type="text" />
                                        ～
                                        <input class="form-control w100" id="auditEndDate" name="auditEndDate" value="" readonly="readonly" type="text" />
                                        <button type="button" class="btn btn-default btn-sm" onclick="bill.timeClear2();">清 空</button>
                                    </span>

                                    <span>
                                        <button type="button" class="btn btn-primary" onclick="bill.search();">查 询</button>&nbsp;&nbsp;
                                        <button type="button" class="btn btn-warning" onclick="bill.clear();">重 置</button>
                                    </span>

                                </td>
                            </tr>

                            </tbody>
                        </table>
                    </form>
                </div>
            </div>

            <table id="flex" style="display:none"></table>

        </div>


</div>

<div id="pop_up" style="display: none">
    <div class="panel">

        <div class="panel-body">

            <form id="distribution_form" onsubmit="return false;" class="form-horizontal">


                <div class="form-group">
                    <label class="col-sm-3 control-label" for="distribution_id_up">
                        <span class="red">*</span>
                        处理备注：
                    </label>
                    <div class="col-sm-9">
                        <textarea id="complain_dispose_remark" name="complain_dispose_remark" style="height: 100px;"></textarea>
                    </div>
                </div>

            </form>

        </div>

    </div>
</div>
<script type="text/javascript">

$("#flex").flexigrid({
    url:"/invokingAjax-backend/bill/billComplain.ajax?operFlg=1&xjx=none",
    dataType: "json",
    colModel : [
        {display: "操作", width : 100, align: "center"},
        {display: "状态", width : 70, align: "center"},
        {display: "创建时间", width : 150,name:"createTime",sortable: "true"},
        {display: "订单编号", align : 'center' , width : 130 },
        {display: "会员名", width : 100},
        {display: "手机号码", width : 100},
        {display: "投诉内容", width : 200},
        {display: "投诉处理人", width : 80},
        {display: "投诉处理时间", width : 150},
        {display: "投诉处理备注", width : 300}

    ],
    sortname: "createTime",
    sortorder: "desc",
    usepager: true,
    rp: 10,
    useRp: true,
    showTableToggleBtn: true,
    autoload: true,
    onSubmit: function() {
        var dt = $('#search_form').serializeArray();
        $("#flex").flexOptions({params: dt});
        return true;
    }
});

var bill = {

    return_no: '',
    complain_id:'',
    search: function() {
        var dt = $("#search_form").serializeArray();
        $("#flex").flexOptions({newrp: 1, params: dt}).flexReload();
    },

    load: function() {
        $("#flex").flexReload();
    },

    clear : function (){
        $(".form-control").val('');
        $("#return_reason_id").val(-1);
        $("#return_status").val(-1);
        this.search();
    },
    timeClear1: function() {
        $('#startDate').val('');
        $('#endDate').val('');
    },
    timeClear2: function() {
        $('#auditStartDate').val('');
        $('#auditEndDate').val('');
    },

//    dealComplain:function( complain_id ){
//        bill.complain_id = complain_id;
//        E.popup.open({
//            id: 'pop_up',
//            title: '维权投诉处理',
//            css: 'width: 600px;',
//            btnName: '保存',
//            btnCall: 'bill.check();'
//        });
//    },

    //处理维权投诉
    dealComplain: function( complain_id ){
        E.open ("/quanliadmin/app/bill/billComplain.pscript?operFlg=2&complain_id=" + complain_id, "" , {height: 600,width: 980, top: 50, left: 200});
    }

};


$('#startDate').datepicker();
$('#endDate').datepicker();
$('#auditStartDate').datepicker();
$('#auditEndDate').datepicker();

</script>

</body>
</html>